﻿@using System.Globalization
@model Decimal?
           
@{
    Decimal? editorSource = 0;
    if (Model.HasValue)
    {
        editorSource = Model;
    }
    bool RenderEmptyWhenZero = (ViewBag.RenderEmptyWhenZero != null && ViewBag.RenderEmptyWhenZero ? true : false);
}


@Html.TextBox("", (RenderEmptyWhenZero && editorSource == 0 ? "" : editorSource.Value.ToString("0.00")), 
                                                            new {
                                                                    @class = "numeric" + ((ViewBag.Required != null && ViewBag.Required) ? " Required" : ""),
                                                                    style = "width: " + (ViewBag.Width != null ? ViewBag.Width : "60") + "px"
                                                                })
